.class public Llt/noframe/gpsfarmguide/gui/ManualGui;
.super Ljava/lang/Object;
.source "ManualGui.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/gui/Gui;


# instance fields
.field private actionButtonsBar:Landroid/view/View;

.field private calculationsBar:Landroid/view/View;

.field private ctx:Landroid/content/Context;

.field private rootView:Landroid/widget/FrameLayout;


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$000(Llt/noframe/gpsfarmguide/gui/ManualGui;)Landroid/content/Context;
    .locals 0

    .line 28
    iget-object p0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    return-object p0
.end method

.method private addCalculationsBar(Landroid/content/Context;Landroid/view/LayoutInflater;Landroid/widget/FrameLayout;I)V
    .locals 3

    const/4 v0, 0x0

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-ne p4, v2, :cond_0

    const p4, 0x7f0c0076

    .line 166
    invoke-virtual {p2, p4, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    iput-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    .line 167
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p4

    invoke-virtual {p4, p1}, Llt/noframe/gpsfarmguide/Data;->getToolbarheight(Landroid/content/Context;)I

    move-result p4

    invoke-virtual {p2, v1, p4, v1, v1}, Landroid/view/View;->setPadding(IIII)V

    .line 168
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p3, p2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 169
    invoke-static {}, Llt/noframe/gpsfarmguide/utils/Calculations;->getInstance()Llt/noframe/gpsfarmguide/utils/Calculations;

    move-result-object p2

    invoke-virtual {p2, p1}, Llt/noframe/gpsfarmguide/utils/Calculations;->iniDistance(Landroid/content/Context;)V

    goto :goto_0

    :cond_0
    const/4 v2, 0x2

    if-ne p4, v2, :cond_1

    const p4, 0x7f0c0075

    .line 171
    invoke-virtual {p2, p4, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    iput-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    .line 172
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p4

    invoke-virtual {p4, p1}, Llt/noframe/gpsfarmguide/Data;->getToolbarheight(Landroid/content/Context;)I

    move-result p4

    invoke-virtual {p2, v1, p4, v1, v1}, Landroid/view/View;->setPadding(IIII)V

    .line 174
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p3, p2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 177
    invoke-static {}, Llt/noframe/gpsfarmguide/utils/Calculations;->getInstance()Llt/noframe/gpsfarmguide/utils/Calculations;

    move-result-object p2

    const-wide p3, 0x7fefffffffffffffL    # Double.MAX_VALUE

    invoke-virtual {p2, p1, p3, p4}, Llt/noframe/gpsfarmguide/utils/Calculations;->iniArea(Landroid/content/Context;D)V

    :cond_1
    :goto_0
    return-void
.end method

.method private setButtonListeners()V
    .locals 3

    .line 99
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    const v1, 0x7f090277

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageButton;

    .line 100
    new-instance v1, Llt/noframe/gpsfarmguide/gui/ManualGui$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/gui/ManualGui$1;-><init>(Llt/noframe/gpsfarmguide/gui/ManualGui;)V

    invoke-virtual {v0, v1}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 107
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->actionButtonsBar:Landroid/view/View;

    const v1, 0x7f0900d1

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageButton;

    .line 109
    new-instance v1, Llt/noframe/gpsfarmguide/gui/ManualGui$2;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/gui/ManualGui$2;-><init>(Llt/noframe/gpsfarmguide/gui/ManualGui;)V

    invoke-virtual {v0, v1}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 116
    iget-object v1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    const v2, 0x7f090193

    invoke-virtual {v1, v2}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageButton;

    .line 117
    new-instance v2, Llt/noframe/gpsfarmguide/gui/ManualGui$3;

    invoke-direct {v2, p0}, Llt/noframe/gpsfarmguide/gui/ManualGui$3;-><init>(Llt/noframe/gpsfarmguide/gui/ManualGui;)V

    invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 133
    iget-object v1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    const v2, 0x7f090063

    invoke-virtual {v1, v2}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageButton;

    .line 134
    new-instance v2, Llt/noframe/gpsfarmguide/gui/ManualGui$4;

    invoke-direct {v2, p0}, Llt/noframe/gpsfarmguide/gui/ManualGui$4;-><init>(Llt/noframe/gpsfarmguide/gui/ManualGui;)V

    invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 150
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    new-instance v2, Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;

    invoke-direct {v2, v0}, Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;-><init>(Landroid/widget/ImageButton;)V

    invoke-virtual {v1, v2}, Llt/noframe/gpsfarmguide/Data;->setAddDeleteState(Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;)V

    .line 151
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getAddDeleteState()Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/states/add_delete_states/DeleteState;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/add_delete_states/DeleteState;-><init>()V

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;->setState(Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteState;)V

    return-void
.end method


# virtual methods
.method public clearGui(I)V
    .locals 1

    .line 65
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->actionButtonsBar:Landroid/view/View;

    invoke-static {p1, v0}, Llt/noframe/gpsfarmguide/utils/Animations;->bottomDown(Landroid/content/Context;Landroid/view/View;)V

    .line 66
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-static {p1, v0}, Llt/noframe/gpsfarmguide/utils/Animations;->topUp(Landroid/content/Context;Landroid/view/View;)V

    .line 67
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->actionButtonsBar:Landroid/view/View;

    invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->removeView(Landroid/view/View;)V

    .line 68
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->removeView(Landroid/view/View;)V

    .line 69
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    if-eqz p1, :cond_0

    .line 70
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->removeMarkers()V

    .line 71
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Llt/noframe/gpsfarmguide/Data;->setCurrent_measuring(Llt/noframe/gpsfarmguide/models/MeasuringModel;)V

    .line 73
    :cond_0
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    sget-object v0, Llt/noframe/gpsfarmguide/MapClick;->freeModeClick:Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/GoogleMap;->setOnMapClickListener(Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;)V

    return-void
.end method

.method public clearGuiWithMeasure()V
    .locals 1

    .line 56
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->remove()V

    const/4 v0, 0x0

    .line 57
    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gui/ManualGui;->clearGui(I)V

    return-void
.end method

.method public getType()I
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public onOrientationChanged(Z)V
    .locals 8

    .line 83
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    .line 84
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getScreenOrientation(Landroid/content/Context;)I

    move-result v0

    const-wide/high16 v1, 0x4049000000000000L    # 50.0

    const/4 v3, 0x0

    const/4 v4, 0x1

    if-ne v0, v4, :cond_0

    .line 85
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v1, v2, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v5

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v1, v2, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v1

    invoke-virtual {v0, v3, v5, v3, v1}, Lcom/google/android/gms/maps/GoogleMap;->setPadding(IIII)V

    .line 86
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v1

    const-wide v2, 0x405a400000000000L    # 105.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v2, v3, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v2

    invoke-static {v0, v1, v2, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 87
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object p1

    const-wide v1, 0x404b800000000000L    # 55.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v1, v2, v3}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v1

    invoke-static {v0, p1, v1, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    goto :goto_0

    .line 89
    :cond_0
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v0

    const-wide v5, 0x4056800000000000L    # 90.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v7

    invoke-static {v5, v6, v7}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v5

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v1, v2, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v1

    invoke-virtual {v0, v3, v5, v3, v1}, Lcom/google/android/gms/maps/GoogleMap;->setPadding(IIII)V

    .line 90
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v1

    const-wide/high16 v2, 0x4054000000000000L    # 80.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v2, v3, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v2

    invoke-static {v0, v1, v2, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 91
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object p1

    const-wide/high16 v1, 0x4044000000000000L    # 40.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v1, v2, v3}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v1

    invoke-static {v0, p1, v1, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    :goto_0
    return-void
.end method

.method public setGui(Landroid/content/Context;Landroid/widget/FrameLayout;Llt/noframe/gpsfarmguide/models/MeasuringModel;)V
    .locals 3

    .line 37
    iput-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    const-string v0, "layout_inflater"

    .line 38
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    const v1, 0x7f0c006a

    const/4 v2, 0x0

    .line 39
    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 40
    iput-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->rootView:Landroid/widget/FrameLayout;

    .line 41
    iput-object v1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->actionButtonsBar:Landroid/view/View;

    .line 42
    invoke-virtual {p2, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 43
    invoke-virtual {p3}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getMeasuringType()I

    move-result v1

    invoke-direct {p0, p1, v0, p2, v1}, Llt/noframe/gpsfarmguide/gui/ManualGui;->addCalculationsBar(Landroid/content/Context;Landroid/view/LayoutInflater;Landroid/widget/FrameLayout;I)V

    .line 44
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->actionButtonsBar:Landroid/view/View;

    invoke-static {p1, p2}, Llt/noframe/gpsfarmguide/utils/Animations;->bottomUp(Landroid/content/Context;Landroid/view/View;)V

    .line 45
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->ctx:Landroid/content/Context;

    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/ManualGui;->calculationsBar:Landroid/view/View;

    invoke-static {p1, p2}, Llt/noframe/gpsfarmguide/utils/Animations;->topDown(Landroid/content/Context;Landroid/view/View;)V

    .line 46
    invoke-virtual {p3}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->doCalculations()V

    .line 47
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    sget-object p2, Llt/noframe/gpsfarmguide/MapClick;->drawClick:Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;

    invoke-virtual {p1, p2}, Lcom/google/android/gms/maps/GoogleMap;->setOnMapClickListener(Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;)V

    .line 48
    invoke-direct {p0}, Llt/noframe/gpsfarmguide/gui/ManualGui;->setButtonListeners()V

    return-void
.end method
